
*********************************************************************************************************************************************
* This code uses pseudo datasets to perform the main analyses in 
* "Joining Forces: The Spillover Effects of EPA Enforcement Actions and the Role of Socially Responsible Investors"																		
* The provided datasets are pseudo datasets with random numbers that inherit the formats of the original datasets. 
* Therefore, the coefficients are different from those in the main tables which are generated from the original datasets.
**********************************************************************************************************************************************

clear all
set more off
cd "C:/folder"
**********************************************************
*Table 2: Spillover Effects of EPA Enforcement Actions 
* (Note: plantid is randomly generated id)
use "pseudosample1.dta", clear
reghdfe sdonsite treat_post1, absorb( plantid#cohort year#cohort) vce(cluster plantid year)
estimates store x1, title(Model 1)
reghdfe lnrsei_score treat_post1 , absorb(plantid#cohort year#cohort) vce(cluster plantid year) 
estimates store x2, title(Model 2)
reghdfe sdonsite treat_post1 size bm roa   lnsale lev , absorb( plantid#cohort year#cohort ) vce(cluster plantid year) 
estimates store x3, title(Model 3)
reghdfe lnrsei_score treat_post1 size bm roa   lnsale lev, absorb( plantid#cohort year#cohort ) vce(cluster plantid year) 
estimates store x4, title(Model 4)
**********************************************************
*Table 3 : The Role of Local SRMFs
*(Note: plantid is randomly generated id)
use "pseudosample1.dta", clear
reghdfe sdonsite treat_close_post_closemf  treat_post1 , absorb( plantid#cohort year#cohort ) vce(cluster plantid year) 
estimates store x1, title(Model 1)
reghdfe lnrsei_score treat_close_post_closemf  treat_post1 , absorb( plantid#cohort year#cohort ) vce(cluster plantid year) 
estimates store x2, title(Model 2)
**********************************************************
*Table 4 :  Inspections and Local SRMFs
*(Note: plantid is randomly generated id)
use "pseudosample2.dta", clear
reghdfe lnnum_inspection   treat_post1, absorb( plantid#cohort year#cohort ) vce(cluster  plantid year) 
estimates store x1, title(Model 1)
reghdfe inspect   treat_post1, absorb( plantid#cohort year#cohort ) vce(cluster  plantid year ) 
estimates store x2, title(Model 2)
reghdfe lnnum_inspection treat_close_post_closemf treat_post1, absorb( plantid#cohort year#cohort ) vce(cluster  plantid year) 
estimates store x3, title(Model 3)
reghdfe inspect treat_close_post_closemf   treat_post1, absorb( plantid#cohort year#cohort ) vce(cluster plantid year ) 
estimates store x4, title(Model 4)
**********************************************************
*Table 5: MF Taxi Trips to Plants in NYC
*(Note: plantid and fundid are randomly generated)
use "pseudosample3.dta", clear
reghdfe mfvisit treat_post_srmf treat_post srmf_post treat_srmf, absorb( plantid#cohort fundid#cohort year#cohort)  vce(cluster  fundid  plantid) 
estimates store x1, title(Model 1)
reghdfe lnnum_mftrip treat_post_srmf treat_post srmf_post treat_srmf, absorb( plantid#cohort fundid#cohort year#cohort)  vce(cluster fundid  plantid) 
estimates store x2, title(Model 2)
**********************************************************
*Table 6 : SRMFs portfolio holding
*(Note: firmid and fundid are randomly generated)
use "pseudosample4.dta", clear
reghdfe dweight  treatfirmpost_closemf_nrespond treatfirmpost_closemf treatfirmpost_nrespond treatfirm_post  ln_fsize exp_ratio turn_ratio rret fund_flows, absorb( fundid firmid year ) vce(cluster fundid firmid) 
estimates store x1, title(Model 1)
reghdfe dweight treatfirmpost_closemf_nrespond treatfirmpost_closemf treatfirmpost_nrespond treatfirm_post ln_fsize exp_ratio turn_ratio rret fund_flows, absorb( fundid sic2 year ) vce(cluster fundid sic2) 
estimates store x2, title(Model 2)
**********************************************************
*Table 7: Treated Plants' Pollution Abatement Activities
*(Note: plantid is randomly generated id)
use "pseudosample5.dta", clear
reghdfe process treat_close_post_closemf treat_post1 , absorb( plantid#cohort year#cohort  ) vce(cluster plantid year ) 
estimates store x1, title(Model 1)
reghdfe practice treat_close_post_closemf treat_post1 , absorb( plantid#cohort year#cohort ) vce(cluster plantid year) 
estimates store x2, title(Model 2)
**********************************************************
*Table 8 : Distant Plants' Abatement Activities
*(Note: plantid is randomly generated id)
use "pseudosample6.dta", clear
reghdfe process  treatfirm_closemf_post treat_post1 , absorb( plantid#cohort year#cohort )  vce(cluster plantid year  ) 
estimates store x1, title(Model 1)
reghdfe practice  treatfirm_closemf_post treat_post1 , absorb( plantid#cohort year#cohort  )  vce(cluster plantid year ) 
estimates store x2, title(Model 2)
use "pseudosample7.dta", clear
reghdfe process  treatfirm_closemf_post treat_post1 , absorb(plantid#cohort year#cohort )  vce(cluster plantid year ) 
estimates store x3, title(Model 3)
reghdfe practice  treatfirm_closemf_post treat_post1 , absorb( plantid#cohort year#cohort)  vce(cluster plantid year) 
estimates store x4, title(Model 4)
**********************************************************
*Table 9 : Long-Run Responses and the Role of Local SRMFs
*(Note: plantid is randomly generated id)
use "pseudosample8.dta", clear
reghdfe sdonsite treat_close_post_closemf treat_post1, absorb( plantid#cohort year#cohort ) vce(cluster plantid year ) 
estimates store x1, title(Model 1)
reghdfe lnrsei_score treat_close_post_closemf treat_post1, absorb( plantid#cohort year#cohort ) vce(cluster plantid year) 
estimates store x2, title(Model 2)
**********************************************************
*Table 10 : firm level evidence
*(Note: firmid is randomly generated id)
use "pseudosample9.dta", clear
reghdfe sdonsite treat_close_post_closemf treat_post1  , absorb( firmid#cohort year#cohort) vce(cluster firmid) 
estimates store x1, title(Model 1)
reghdfe lnrsei_score treat_close_post_closemf treat_post1  , absorb( firmid#cohort year#cohort) vce(cluster firmid) 
estimates store x2, title(Model 2)
use "pseudosample10.dta", clear
reghdfe sdonsite  treat_close_post_closemf treat_post1, absorb( firmid#cohort year#cohort) vce(cluster firmid ) 
estimates store x3, title(Model 3)
reghdfe lnrsei_score treat_close_post_closemf treat_post1, absorb(firmid#cohort year#cohort) vce(cluster firmid )
estimates store x4, title(Model 4)
use "pseudosample11.dta", clear
reghdfe roa treat_post1_reduonsite treat_post1 size bm lev , absorb( firmid#cohort year#cohort ) vce(cluster firmid ) 
estimates store x1, title(Model 1)
reghdfe roa treat_post1_redursei treat_post1 size bm lev, absorb( firmid#cohort year#cohort ) vce(cluster firmid) 
estimates store x2, title(Model 2)
reghdfe roa treat_post1_reduonsite treat_post1 treat_close_post_closemf treat_post1_closemf_reduonsite size bm lev, absorb( firmid#cohort year#cohort) vce(cluster firmid) 
estimates store x3, title(Model 3)
reghdfe roa treat_post1_redursei treat_post1 treat_close_post_closemf treat_post1_closemf_redursei size bm lev, absorb( firmid#cohort year#cohort) vce(cluster firmid)
estimates store x4, title(Model 4)

